<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@include file="/common/common.jsp"%>
<h:css href="/css/style1/style-custom.css"/>
<%@include file="/common/skins/skin0/component.jsp" %>
<%--
- Author(s): pengweiling
- Date: 2012-07-14 06:39:17
- Description:
--%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>
      订单浏览
    </title>
  </head>
  <body>
    <e:datasource name="criteria" type="entity" path="com.primeton.das.criteria.criteriaType" />
    <e:datasource name="page" type="entity" path="com.eos.foundation.PageCond" />
    <e:datasource name="weordersvs" type="entity" path="com.hms.OrderMgr.order.WeOrdersV" />
    <queryform id= "9b1ec4ae-0cc1-4347-8b64-0a9d2e86392a">
      <h:form  name="query_form" action="com.hms.OrderMgr.WeOrdersVMaintain.flow" checkType="blur" target="_self" method="post" onsubmit="return checkForm(this);">
          <input type="hidden" name="_eosFlowAction" value="pageQuery"/>
          <input type="hidden" name="criteria/_expr[12]/ccategory" value="A"/>
          <h:hiddendata property="fixCond"/>
          <table align="center" border="0" width="100%" class="form_table">
            <tr>
              <td class="form_label">
                房号
              </td>
              <td colspan="1">
                <h:text property="criteria/_expr[1]/croomno"/>
                <h:hidden property="criteria/_expr[1]/_op" value="like"/>
                <h:hidden property="criteria/_expr[1]/_likeRule" value="all"/>
              </td>
              <td class="form_label">
                房型
              </td>
              <td colspan="1">
                <d:select dictTypeId="HMS_Room_Type"  nullLabel="请选择" property="criteria/_expr[2]/croomtype" style="width:128px;"/>
                <h:hidden property="criteria/_expr[2]/_op" value="="/>
              </td>
              <td class="form_label">
                客单号
              </td>
              <td colspan="1">
                <h:text property="criteria/_expr[3]/cgresno"/>
                <h:hidden property="criteria/_expr[3]/_op" value="like"/>
                <h:hidden property="criteria/_expr[3]/_likeRule" value="all"/>
              </td>
              <td class="form_label">
                订单号
              </td>
              <td colspan="1">
                <h:text property="criteria/_expr[4]/corderno"/>
                <h:hidden property="criteria/_expr[4]/_op" value="like"/>
                <h:hidden property="criteria/_expr[4]/_likeRule" value="all"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                预订人姓名
              </td>
              <td colspan="1">
                <h:text property="criteria/_expr[5]/cbookname"/>
                <h:hidden property="criteria/_expr[5]/_op" value="like"/>
                <h:hidden property="criteria/_expr[5]/_likeRule" value="all"/>
              </td>
              <td class="form_label">
                预订会员号
              </td>
              <td colspan="1">
                <h:text property="criteria/_expr[6]/cmembername"/>
                <h:hidden property="criteria/_expr[6]/_op" value="like"/>
                <h:hidden property="criteria/_expr[6]/_likeRule" value="all"/>
              </td>
              <td class="form_label">
                预订人电话
              </td>
              <td colspan="1">
                <h:text property="criteria/_expr[7]/cbooktel"/>
                <h:hidden property="criteria/_expr[7]/_op" value="="/>
              </td>
              <td class="form_label">
                证件号码
              </td>
              <td colspan="1">
                <h:text property="criteria/_expr[8]/cidnumber"/>
                <h:hidden property="criteria/_expr[8]/_op" value="like"/>
                <h:hidden property="criteria/_expr[8]/_likeRule" value="all"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                入住日期（从)
              </td>
              <td colspan="1">
                <h:hidden property="criteria/_expr[9]/_op" value="between" />
                <h:hidden property="criteria/_expr[9]/arrorigdate" value=" " />
                <h:hidden property="criteria/_expr[9]/_pattern" value="yyyy-MM-dd"/>
                <w:date property="criteria/_expr[9]/_min"/>
              </td>
              <td class="form_label">
                入住日期（到)
              </td>
              <td colspan="1">
                <w:date property="criteria/_expr[9]/_max"/>
              </td>              
              <td class="form_label">
                离店日期（从)
              </td>
              <td colspan="1">
                <h:hidden property="criteria/_expr[10]/_op" value="between" />
                <h:hidden property="criteria/_expr[10]/deporigdate" value=" " />
                <h:hidden property="criteria/_expr[10]/_pattern" value="yyyy-MM-dd"/>
                 <w:date property="criteria/_expr[10]/_min"/>
              </td>
              <td class="form_label">
                离店日期(到)
              </td>
              <td colspan="1">
                <w:date property="criteria/_expr[10]/_max"/>
              </td>
            </tr>
            <tr>                      
              <td class="form_label">
                业务员
              </td>
              <td colspan="1">
                <h:text property="criteria/_expr[11]/salesname"/>
                <h:hidden property="criteria/_expr[11]/_op" value="like"/>
                <h:hidden property="criteria/_expr[11]/_likeRule" value="all"/>
              </td>
              <td class="form_label">
              </td>
              <td colspan="1">
              </td>
              <td class="form_label">
              </td>
              <td colspan="1">
              </td>
              <td class="form_label">
              </td>
              <td colspan="1">
              </td>                                        
            </tr>
            <tr class="form_bottom">
              <td colspan="8" class="form_bottom">
                <input type="hidden" name="criteria/_entity" value="com.hms.OrderMgr.order.WeOrdersV">
                每页显示
                <h:text size="2" property="page/length" value="10" validateAttr="minValue=1;maxValue=100;type=integer;isNull=true" />
                <input type="hidden" name="page/begin" value="0">
                <input type="hidden" name="page/isCount" value="true">
                <input type="submit" value="查询" class="button">
              </td>
            </tr>
          </table>
      </h:form>
    </queryform>
    <br/>
    <viewlist id= "f79baaa0-d847-4c3f-9973-fb85dfa1db56">
      <h:form name="page_form" action="com.hms.OrderMgr.WeOrdersVMaintain.flow" method="post">
        <input type="hidden" name="_eosFlowAction" value="pageQuery" >
        <h:hiddendata property="criteria" />
        <h:hiddendata property="fixCond"/>
        <h:hidden property="page/begin"/>
        <h:hidden property="page/length"/>
        <h:hidden property="page/count"/>
        <h:hidden property="page/isCount"/>
          <table align="center" border="0" width="100%" class="EOS_table">
            <tr>
              <th align="center">
                选择
              </th>
              <th>
                订单编号
              </th>
              <th>
                客单号
              </th>
              <th>
                订单状态
              </th>
              <th>
                客单状态
              </th>
              <th>
                客人姓名
              </th>
              <th>
                证件号码
              </th>
              <th>
                小区
              </th>
              <th>
                栋号
              </th>               
              <th>
                房号
              </th>
              <th>
                房型
              </th>                           
              <th>
                抵店日期
              </th>
              <th>
                离店日期
              </th>
              <th>
                账单余额
              </th>
              <th>
                预订人姓名
              </th>
              <th>
                预订人电话
              </th>
              <th>
                会员编号
              </th>              
              <th>
                预订人会员
              </th>
            </tr>
            <w:checkGroup id="group1">
              <l:iterate property="weordersvs" id="id1">
                <tr class="<l:output evenOutput='EOS_table_row' />">
                  <td align="center">
                      <w:rowCheckbox>
                        <h:param name='select_objs/iorderid' iterateId='id1' property='iorderid' indexed='true' />
                      </w:rowCheckbox>
                  </td>
                  <td>
                    <b:write iterateId="id1" property="corderno"/>
                  </td>
                  <td>
                    <b:write iterateId="id1" property="cgresno"/>
                  </td>
                  <td>
                <l:equal  iterateId="id1" property="orderstatus" targetValue="C">
                   取消
                </l:equal>
                <l:equal iterateId="id1" property="orderstatus" targetValue="B">
                   待审核
                </l:equal>
                <l:equal iterateId="id1" property="orderstatus" targetValue="P">
                   待支付确认
                </l:equal>    
                <l:equal iterateId="id1" property="orderstatus" targetValue="Y">
                   审核确认
                </l:equal> 
                <l:equal iterateId="id1" property="orderstatus" targetValue="I">
                   入住
                </l:equal>                                               
                <l:equal iterateId="id1" property="orderstatus" targetValue="O">
                   已结
                </l:equal>        
                <l:equal iterateId="id1" property="orderstatus" targetValue="X">
                   已退未结算
                </l:equal>      
                <l:equal iterateId="id1" property="orderstatus" targetValue="D">
                   已结未退
                </l:equal>    
                <l:equal iterateId="id1" property="orderstatus" targetValue="S">
                   未提交
                </l:equal>                    
                  </td>
                  <td>
                <l:equal  iterateId="id1" property="cstatus" targetValue="R">
                   预订
                </l:equal>
                <l:equal  iterateId="id1" property="cstatus" targetValue="I">
                   在住
                </l:equal>         
                <l:equal  iterateId="id1" property="cstatus" targetValue="O">
                   离店
                </l:equal>       
                <l:equal  iterateId="id1" property="cstatus" targetValue="N">
                   未到
                </l:equal>        
                <l:equal  iterateId="id1" property="cstatus" targetValue="X">
                   取消
                </l:equal>                                                          
                  </td>
                  <td>
                    <b:write iterateId="id1" property="cguestname"/>
                  </td>
                  <td>
                    <b:write iterateId="id1" property="cidnumber"/>
                  </td>
                  <td>
                    <b:write iterateId="id1" property="careaname"/>
                  </td>
                  <td>
                    <b:write iterateId="id1" property="cbuilding"/>
                  </td>                  
                  <td>
                    <b:write iterateId="id1" property="croomno"/>
                  </td>
                  <td>
                    <d:write dictTypeId="HMS_Room_Type" iterateId="id1" property="croomtype"/>
                  </td>
                  <td>
                    <l:empty iterateId="id1" property="darrdate">
                       <b:write iterateId="id1" property="arrorigdate"/>(预计)
                    </l:empty>
                    <l:notEmpty iterateId="id1" property="darrdate">
                       <b:write iterateId="id1" property="darrdate" formatPattern="yyyy-MM-dd HH:mm:ss"/>
                    </l:notEmpty>
                  </td>
                  <td>
                    <l:empty iterateId="id1" property="ddepdate">
                       <b:write iterateId="id1" property="deporigdate"/>(预计)
                    </l:empty>
                    <l:notEmpty iterateId="id1" property="ddepdate">
                       <b:write iterateId="id1" property="ddepdate"/>
                    </l:notEmpty>                  
                  </td>
                  <td>
                    <b:write iterateId="id1" property="balanceamount"/>
                  </td>
                  <td>
                    <b:write iterateId="id1" property="cbookname"/>
                  </td>
                  <td>
                    <b:write iterateId="id1" property="cbooktel"/>
                  </td>
                  <td>
                    <b:write iterateId="id1" property="cmembercode"/>
                  </td>                  
                  <td>
                    <b:write iterateId="id1" property="cmembername"/>
                  </td>
                </tr>
              </l:iterate>
            </w:checkGroup>
            <tr>
              <td colspan="20" class="command_sort_area">
                <div style="float:left">
                <l:equal property="isFront" targetValue="Y" scope="f">
                  <l:notEmpty property="MGRTYPE">
                    <l:equal property="MGRTYPE" targetValue="RUZHU"> 
                      <input type="button" value="直接入住" onclick="walkin();" class="button">
                    </l:equal>                   
                  </l:notEmpty>
                  
                  <l:empty  property="MGRTYPE">
                    <input type="button" value="直接入住/预订" onclick="walkin();" class="button">
                  </l:empty>
                  
                </l:equal>
                
                <l:greaterThan property="page/size" targetValue="0" compareType="number">
                
                  <l:notEmpty property="MGRTYPE">
                    <l:equal property="MGRTYPE" targetValue="RUZHU"> 
                      <input type="button" value="预订入住" onclick="updateRecord();" class="button">
                    </l:equal> 
                    <l:equal property="MGRTYPE" targetValue="ZAIZHU"> 
                      <input type="button" value="在住详情" onclick="updateRecord();" class="button">
                    </l:equal>                                 
                  </l:notEmpty>
                  
                  <l:empty  property="MGRTYPE">
                    <input type="button" value="订单详情" onclick="updateRecord();" class="button">
                  </l:empty>
                                    
                  <l:notEqual property="isFront" targetValue="Y" scope="f">
                    <input type="button" value="修改申请" onclick="modifyOrder();" class="button">     
                  </l:notEqual>
                                  
                               
                 
                </l:greaterThan>
                </div>                
                <div style="float:right">
                  <l:equal property="page/isCount" targetValue="true">
                    共
                    <b:write property="page/count"/>
                    条记录 第
                    <b:write property="page/currentPage"/>
                    页/
                    <b:write property="page/totalPage"/>
                    页
                  </l:equal>
                  <l:equal property="page/isCount" targetValue="false">
                    第
                    <b:write property="page/currentPage"/>
                    页
                  </l:equal>
                  <input type="button" onclick="firstPage('page', 'pageQuery', null, null, 'page_form');" value="首页"  <l:equal property="page/isFirst" targetValue="true">disabled</l:equal> >
                  <input type="button" onclick="prevPage('page', 'pageQuery', null, null, 'page_form');" value="上页" <l:equal property="page/isFirst" targetValue="true">disabled</l:equal> >
                  <input type="button" onclick="nextPage('page', 'pageQuery', null, null, 'page_form');" value="下页" <l:equal property="page/isLast" targetValue="true">disabled</l:equal> >
                  <l:equal property="page/isCount" targetValue="true">
                    <input type="button" onclick="lastPage('page', 'pageQuery', null, null, 'page_form');" value="尾页" <l:equal property="page/isLast" targetValue="true">disabled</l:equal> >
                  </l:equal>
                </div>
              </td>
            </tr>
          </table>
      </h:form>
    </viewlist>
    <script>
      function updateRecord()
      {
        var g = $id("group1");
        var frm = $name("page_form");
        if (g.getSelectLength() != 1) {
          alert("请选择一行记录！");
          return;
        }
        frm.elements["_eosFlowAction"].value = "update";
        frm.submit();
      }
      
      function walkin()
      {
        var frm = $name("page_form");
        frm.elements["_eosFlowAction"].value = "walkin";
        frm.submit();
      }
      
      function deleteRecord()
      {
        var g = $id("group1");
        var frm = $name("page_form");
        if (g.getSelectLength() < 1) {
          alert("请选择记录！");
          return;
        }
        frm.elements["_eosFlowAction"].value = "delete";
        frm.submit();
      }
      
      function modifyOrder(){
        var g = $id("group1");
        var frm = $name("page_form");
        if (g.getSelectLength() != 1) {
          alert("请选择一行记录！");
          return;
        }
        frm.elements["_eosFlowAction"].value = "modify";
        frm.submit();
      
      }
      
    </script>
  </body>
</html>
